#ifndef  SCAN_FAT_H
#define  SCAN_FAT_H


#include "tff.h"
#include "file_scan.h"

typedef enum
{
	SCAN_SEEK,
	SCAN_SEEKOVER,
	SCAN_DRAW,
	SCAN_FINDNUM,
	SCAN_FILECOUNT,
	SCAN_NODRAW
}SCAN_MODE;




extern FATFS xdata fat_fs;

void  fscan_opendir(DIR _xdata * dj);
FRESULT fscan_readnextdir (DIR _xdata* dj, DIRINFO _xdata* dinfo);
void fscan_init(u8 _xdata * buf);
FRESULT scan_search_dir_entry(u16 sclusth, u16 sclustl, DIR _xdata * dj);
u8 f_cal_lfn(u8 _xdata * lfn_buf, u8 _xdata * dir_buf);
u8  next_dir_entry (DIR _xdata *dj);
u8  move_window (u32 sector);
u8 scanFileInCurDir(u8 mode ,u8 deepth, DIR_RECODE  xdata *dir_recode);
u32 clust2sect (u32 clust);
u32 get_cluster (u32 clust);
#endif